package com.itlong.cloud.POJO.VO;

import com.itlong.cloud.enumerate.ecode.ErrorCode;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 响应结果
 *
 * @craeteDate 2021-05-17
 */
@Data
@NoArgsConstructor
public class SDKMessageV3 implements Serializable {

    private Integer msgCode;

    private String msg;

    private String requestId;

    private String timestamp;

    private Object data = "";

    public SDKMessageV3(ErrorCode errorCode) {
        super();
        this.setMsgCode(errorCode.getErrorValue());
        this.setMsg(errorCode.getCodeMsg());
        this.setRequestId("");
        this.setTimestamp((new Date()).getTime() + "");
        this.setData("");
    }

    public SDKMessageV3(ErrorCode errorCode, String requestId) {
        super();
        this.setMsgCode(errorCode.getErrorValue());
        this.setMsg(errorCode.getCodeMsg());
        this.setRequestId(requestId);
        this.setTimestamp((new Date()).getTime() + "");
        this.setData("");
    }

    public SDKMessageV3(ErrorCode errorCode, String requestId, Object data) {
        super();
        this.setMsgCode(errorCode.getErrorValue());
        this.setMsg(errorCode.getCodeMsg());
        this.setRequestId(requestId);
        this.setTimestamp((new Date()).getTime() + "");
        this.setData(data);
    }

}